//
//  Menu.h
//  MKUITestApp
//
//  Created by 苏尚进 on 2020/8/22.
//  Copyright © 2020 moon. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN

@interface Menu : NSObject<NSCopying>
@property(nonatomic,strong,nullable) UIImage *icon;//小图标
@property(nonatomic,strong,nullable) NSString *iconName;
@property(nonatomic,strong,nullable) NSString *iconUrl;
@property(nonatomic,strong,nullable) NSString *title;//标题
@property(nonatomic,strong,nullable) NSString *badge;//角标
@property(nonatomic,strong,nullable) UIImage *originImage;
+ (NSArray<Menu *> *)sharedMenus;
+ (NSArray<Menu *> *)sharedMenusWithCount:(NSInteger)count;
+ (NSArray<Menu *> *)sharedMenusWithCount:(NSInteger)count haveAddMenu:(BOOL)haveAddMenu;
+ (NSArray<Menu *> *)sharedUrlMenus;
+ (Menu *)menuWithIconName:(nullable NSString *)iconName title:(nullable NSString *)title badge:(nullable NSString *)badge;
//模拟异步获取图片iconName或iconUrl图片
- (void)getIconWithCompletion:(void(^)(UIImage *image,NSError *error))completion;
+ (Menu *)random;
+ (Menu *)addMenu;
+ (UIImage *)randomImage;
@end

@interface MenuGroup : NSObject
@property(nonatomic,strong,nullable) NSArray<Menu *> *menus;
@property(nonatomic,strong,nullable) NSString *title;
@property(nonatomic,assign) BOOL expand;
+ (MenuGroup *)menuGroupWithTitle:(nullable NSString *)title menus:(nullable NSArray<Menu *> *)menus;
- (void)removeMenu:(Menu *)menu;
@end

NS_ASSUME_NONNULL_END
